package demo;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

public class Waiter {
    private List<Food> foodList = new ArrayList<>();

    @Resource
    private Order order = new Order();

    public void setOrder(Food food) {
        if(order.getMakeInfo(food)){
            System.out.println("有"+food.getName()+"可以下单");
            foodList.add(food);
        }else{
            System.out.println("没有"+food.getName());
        }
    }

    public void noticeOrder() {
        if(foodList.size()>0){
            order.noticeOrder(foodList);
        }else{
            System.out.println("未点菜");
        }
    }
}
